package cn.tedu.spring.eg3;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Controller
public class ShopController {
    private int count;

    public ShopController() {
        System.out.println("第一步通过无参构造方法实例化！");
    }
    @Value("100")
    public void setCount(int count) {
        System.out.println("第二步通过set方法进行属性赋值！");
        this.count = count;
    }
    @PostConstruct
    public void init(){
        System.out.println("第三步通过PostConstruct注解来进行初始化操作!");
    }
    @PreDestroy
    public void destory(){
        System.out.println("第五步通过PreDestory注解来进行对象销毁操作!");
    }

}
